<?php
/**
 * Created by PhpStorm.
 * User: iwm
 * Date: 2017/1/24
 * Time: 11:33
 */
namespace app\home\model\page\user;

use app\api\model\dao\UserCoupon;
use app\library\Flag;

class GetUserCoupon
{
    public function excute($param)
    {
        $ret = $this->checkToken($param);
        if (false === $ret) {
            return $this->getRes(Error::ERR_NO_AUTH);
        }
        $obj = new \app\api\model\dao\UserCoupon();
        $fields = ['create_time', 'create_time'];
        $conds = [
            'user_id' => Flag::ADDRESS_STATUS_ACTIVE,
        ];
        $data = $obj->where($conds)->field($fields, true)->paginate();
        return $data;
    }
}
